package br.com.ravi.deposito.listeners;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import br.com.ravi.deposito.utils.hibernate.HibernateUtil;


/**
 * 
 * @author Rafael Ingaramo
 *
 */
@WebListener()
public class HibernateListener implements ServletContextListener  {
	@Override
	public void contextDestroyed(ServletContextEvent servletContextEvent) {
		HibernateUtil.destroySessionFactory();
	}

	@Override
	public void contextInitialized(ServletContextEvent servletContextEvent) {
		//TODO: Logar que inicializou
		HibernateUtil.buildSessionFactory();
	}
}